:root {
  --primary: #0EA5E9;
  --secondary: #F97316;
  --success: #10B981;
  --danger: #EF4444;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --line: #E2E8F0;
  --shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

* { letter-spacing: 0; }

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  font-weight: 400;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: #0284c7; }

button,
input,
select,
textarea,
.btn,
.form-control,
.form-select {
  font-family: inherit;
}

.btn { border-radius: 10px; font-weight: 700; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: #0284c7;
  border-color: #0284c7;
}
.btn-light {
  background: #fff;
  border-color: var(--line);
}

.app-topbar {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.navbar-brand {
  color: var(--text);
  font-weight: 800;
  white-space: normal;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
}

.dashboard-shell { max-width: 1680px; margin: 0 auto; }

.dashboard-heading,
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-heading h1,
.section-head h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2.4rem);
  font-weight: 850;
}

.eyebrow {
  display: block;
  color: var(--secondary);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  margin-bottom: 18px;
}

.form-control,
.form-select {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 10px;
  font-weight: 500;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(14, 165, 233, .16);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.kpi-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kpi-card {
  position: relative;
  min-height: 140px;
  padding: 20px;
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .75);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -35px -55px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: currentColor;
  opacity: .12;
}

.kpi-card i {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: currentColor;
  background: color-mix(in srgb, currentColor 12%, white);
  border-radius: 12px;
  font-size: 1.35rem;
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.kpi-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: clamp(1.8rem, 2.4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.1;
}

.accent-blue { color: var(--primary); }
.accent-orange { color: var(--secondary); }
.accent-green { color: var(--success); }
.accent-slate { color: #475569; }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr);
  gap: 16px;
}

.panel,
.form-surface,
.auth-card,
.privacy-box {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .85);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.panel { padding: 18px; }
.panel canvas {
  width: 100% !important;
  min-height: 340px;
  max-height: 430px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.rate-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}
.rate-success { color: #047857; background: #D1FAE5; }
.rate-warning { color: #C2410C; background: #FFEDD5; }
.rate-danger { color: #B91C1C; background: #FEE2E2; }

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .96rem;
  font-weight: 900;
  line-height: 1;
}

.status-success { color: #fff; background: #059669; }
.status-warning { color: #713F12; background: #FBBF24; }
.status-danger { color: #fff; background: #DC2626; }

.table {
  --bs-table-color: var(--text);
  font-size: .94rem;
}
.table thead th {
  color: #334155;
  background: #F1F5F9;
  border-bottom: 0;
  white-space: nowrap;
}

.treatment-table-wrap,
.treatment-table-wrap .dataTables_wrapper,
.treatment-table-wrap .dataTables_scroll,
.treatment-table-wrap .dataTables_scrollHead,
.treatment-table-wrap .dataTables_scrollBody {
  width: 100%;
  max-width: 100%;
}

.treatment-table-wrap {
  margin-top: 22px;
  padding-top: 8px;
  overflow: hidden;
}

.treatment-table-wrap .dataTables_scrollBody {
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 0 0 18px 18px;
  overflow-x: auto;
}

.treatment-table-wrap .dataTables_scrollHead {
  border: 1px solid rgba(15, 118, 110, .18);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}

.treatment-table {
  width: 100% !important;
  margin: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 1rem;
}

.treatment-table .col-seq { width: 6%; }
.treatment-table .col-hospital { width: 20%; }
.treatment-table .col-metric,
.treatment-table .col-wide,
.treatment-table .col-rate,
.treatment-table .col-status { width: 12.333%; }

.treatment-table thead th {
  text-align: center !important;
  vertical-align: middle;
  color: #0F172A;
  background: linear-gradient(180deg, #EAF8F5 0%, #DDF4EF 100%);
  border: 1px solid rgba(15, 118, 110, .18);
  font-size: clamp(.78rem, .72vw, .98rem);
  font-weight: 900;
  line-height: 1.25;
  padding: 16px 10px;
  white-space: normal;
  word-break: keep-all;
}

.treatment-table tbody td {
  text-align: center;
  vertical-align: middle;
  color: #0F172A;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 118, 110, .14);
  padding: 15px 10px;
  font-size: clamp(.92rem, .9vw, 1.08rem);
  font-weight: 750;
  line-height: 1.25;
}

.treatment-table tbody tr:nth-child(even) td {
  background: rgba(240, 253, 250, .34);
}

.treatment-table tbody tr:hover td {
  background: rgba(209, 250, 229, .52);
}

.treatment-table tfoot td {
  text-align: center;
  vertical-align: middle;
  color: #0F172A;
  background: linear-gradient(180deg, #DDF4EF 0%, #CFF7EA 100%);
  border: 1px solid rgba(15, 118, 110, .18);
  border-top: 2px solid rgba(15, 118, 110, .32);
  padding: 16px 10px;
  font-size: clamp(.96rem, .92vw, 1.12rem);
  font-weight: 900;
  line-height: 1.25;
}

.treatment-total-row .hospital-name {
  color: #0F172A;
}

.treatment-table .hospital-name {
  font-weight: 800;
  text-align: left !important;
  padding-left: 12px;
  overflow-wrap: anywhere;
}

.treatment-table .hospital-col {
  text-align: left !important;
  padding-left: 12px;
}

.treatment-table .table-number {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 1vw, 1.16rem);
  font-weight: 900;
  color: #0F172A;
}

.treatment-table .rate-pill,
.treatment-table .status-pill {
  min-width: 0;
  width: min(118px, 100%);
  min-height: 34px;
  padding: 8px 10px;
  white-space: nowrap;
}

.treatment-table-wrap .dt-buttons {
  margin-bottom: 18px;
}

.treatment-table-wrap .dataTables_filter {
  margin-bottom: 18px;
}

.table-note-legend {
  margin-top: 12px;
  padding: 12px 14px;
  color: #475467;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: .98rem;
  font-weight: 600;
}

.table-note-legend strong {
  color: #0F172A;
  font-weight: 900;
}

.auth-page {
  min-height: calc(100vh - 65px);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, .16), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, .14), transparent 28rem),
    var(--bg);
}

.auth-panel {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: center;
}

.auth-copy h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
}
.auth-copy p { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.auth-card { padding: 26px; }
.auth-card h2 { font-size: 1.35rem; font-weight: 850; margin-bottom: 16px; }

.form-surface { padding: 20px; }
.privacy-box { padding: 18px; background: #F8FAFC; box-shadow: none; }
.privacy-box h2 { font-size: 1rem; font-weight: 850; }

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 65px);
}

.app-sidebar {
  padding: 18px 14px;
  background: #0F172A;
  color: #CBD5E1;
}
.sidebar-title {
  padding: 8px 12px 14px;
  color: #94A3B8;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.app-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: #E2E8F0;
  border-radius: 10px;
  font-weight: 700;
}
.app-sidebar a:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.admin-content { min-width: 0; padding: 24px; }

.dt-buttons .btn { margin-right: 6px; }

.admin-action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 260px;
}

.admin-action-row .form-select {
  min-height: 32px;
  min-width: 112px;
}

.brand-preview {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--muted);
  background: #F8FAFC;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.brand-preview img {
  max-width: 220px;
  max-height: 64px;
  object-fit: contain;
}

.brand-preview.small-preview img {
  max-width: 48px;
  max-height: 48px;
}

.upload-preview {
  padding: 18px;
  background: #FFFFFF;
  border: 1px solid rgba(217, 226, 225, .95);
  border-left: 5px solid #0F766E;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(15, 35, 55, .1);
}

.upload-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.upload-preview-head h2 {
  margin: 0;
  color: #123047;
  font-size: 1.2rem;
  font-weight: 900;
}

.upload-preview-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: #0F766E;
  background: #DDF5F1;
  border-radius: 999px;
  font-weight: 800;
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.upload-preview-grid div {
  padding: 13px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}

.upload-preview-grid span {
  display: block;
  color: #667085;
  font-size: .86rem;
  font-weight: 700;
}

.upload-preview-grid strong {
  display: block;
  margin-top: 3px;
  color: #0F172A;
  font-size: 1.12rem;
  font-weight: 900;
}

.upload-preview-list {
  margin-bottom: 12px;
  padding: 12px 14px;
  color: #334155;
  background: #F8FAFC;
  border-radius: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.upload-preview-list strong {
  color: #123047;
}

.upload-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.upload-preview-actions form:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.recal-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.recal-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recal-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: 999px;
  font-weight: 850;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.recal-toggle input:checked + span {
  color: #FFFFFF;
  background: linear-gradient(135deg, #D97706, #0F766E);
  border-color: transparent;
  box-shadow: 0 14px 26px rgba(15, 118, 110, .18);
}

.recal-toggle:hover span {
  transform: translateY(-2px);
}

@media (max-width: 1180px) {
  .kpi-grid,
  .kpi-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-heading,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .filter-bar,
  .kpi-grid,
  .kpi-grid.compact,
  .auth-panel,
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
  }
  .sidebar-title { display: none; }
  .app-sidebar a { white-space: nowrap; }
  .admin-content { padding: 16px; }
  .auth-page { place-items: start; }
  .panel canvas { min-height: 300px; }
  .upload-preview-head,
  .upload-preview-actions,
  .upload-preview-actions form:first-child {
    align-items: stretch;
    flex-direction: column;
  }
  .upload-preview-grid { grid-template-columns: 1fr; }
}

/* Public dashboard inspired by the NCD DM HT monitoring layout. */
.dm-dashboard-page {
  background:
    linear-gradient(90deg, #fff 0, #fff 260px, rgba(244, 215, 244, .75) 260px, rgba(235, 231, 255, .85) 100%),
    #F7EAF7;
}

.dm-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.dm-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: rgba(255, 255, 255, .78);
  border-right: 1px solid rgba(234, 71, 160, .12);
  display: flex;
  flex-direction: column;
}

.dm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #D3167E;
  font-size: 1.1rem;
  line-height: 1.1;
  margin-bottom: 26px;
  transition: transform .2s ease;
}

.dm-brand:hover {
  transform: translateY(-2px);
}

.dm-brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #EA47A0, #8B5CF6);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(234, 71, 160, .25);
  animation: logo-float 3.2s ease-in-out infinite;
}

.dm-brand-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 12px;
  animation: logo-float 3.2s ease-in-out infinite;
}

.dm-scroll-section {
  scroll-margin-top: 22px;
}

.dm-nav {
  display: grid;
  gap: 8px;
}

.dm-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  color: #4A5568;
  border-radius: 14px;
  font-weight: 800;
}

.dm-nav a.active,
.dm-nav a:hover {
  color: #D3167E;
  background: #DFE9FF;
}

.dm-login-bottom {
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  color: #fff;
  background: #EA47A0;
  border-radius: 14px;
  font-weight: 850;
  box-shadow: 0 16px 24px rgba(234, 71, 160, .25);
}

.dm-login-bottom:hover { color: #fff; background: #D3167E; }

.dm-main {
  min-width: 0;
  padding: 28px 30px 46px;
}

.dm-float-nav {
  position: fixed;
  right: clamp(18px, 2.4vw, 34px);
  bottom: clamp(22px, 4vw, 46px);
  z-index: 30;
  display: grid;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(.94);
  transition: opacity .24s ease, transform .24s ease;
}

.dm-float-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.dm-float-btn {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0F766E, #123047);
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 18px 34px rgba(15, 35, 55, .24);
  font-size: 1.35rem;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
  animation: float-button-breathe 2.8s ease-in-out infinite;
}

.dm-float-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .35), transparent 54%);
  opacity: .75;
}

.dm-float-btn::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 80px;
  background: rgba(255, 255, 255, .35);
  transform: rotate(24deg) translate(-80px, 16px);
  animation: float-button-shine 3.4s ease-in-out infinite;
}

.dm-float-btn i {
  position: relative;
  z-index: 1;
  animation: float-arrow-nudge 1.6s ease-in-out infinite;
}

.dm-float-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #D97706, #0F766E);
  box-shadow: 0 22px 42px rgba(15, 35, 55, .3);
  transform: translateY(-4px) scale(1.06);
}

.dm-float-btn.is-clicked {
  animation: float-button-pop .36s ease;
}

.dm-float-nav.is-at-top [data-scroll-target="top"],
.dm-float-nav.is-at-bottom [data-scroll-target="bottom"] {
  opacity: .45;
}

.dm-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.dm-heading span {
  color: #D3167E;
  font-weight: 850;
}

.dm-heading h1 {
  margin: 4px 0 0;
  color: #4C1D95;
  font-weight: 950;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
}

.dm-login-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  color: #fff;
  background: #5DA2F4;
  border-radius: 14px;
  font-weight: 850;
}

.dm-filter-panel {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr auto auto;
  gap: 16px;
  align-items: end;
  padding: 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, .92);
  border-radius: 22px;
  box-shadow: 0 20px 45px rgba(126, 34, 206, .08);
}

.dm-filter-panel label {
  color: #334155;
  font-weight: 850;
  font-size: .92rem;
}

.dm-filter-panel .form-control,
.dm-filter-panel .form-select {
  margin-top: 8px;
  border-color: #F9B7DA;
  border-radius: 13px;
}

.dm-search {
  width: 52px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #EA47A0;
  border: 0;
  border-radius: 14px;
  font-size: 1.15rem;
}

.dm-reset {
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #4C1D95;
  background: #F3E8FF;
  border-radius: 14px;
  font-weight: 850;
}

.dm-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
  perspective: 1200px;
}

.dm-kpi {
  position: relative;
  min-height: 174px;
  padding: 22px 20px 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .94)),
    #fff;
  border-radius: 22px;
  box-shadow: 0 20px 45px rgba(126, 34, 206, .08);
  overflow: hidden;
  animation: kpi-rise-in .7s cubic-bezier(.2, .8, .2, 1) both;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.dm-kpi::before {
  content: "";
  position: absolute;
  inset: -45% auto auto -25%;
  width: 58%;
  height: 190%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: rotate(18deg) translateX(-120%);
  animation: kpi-reflection 5.6s ease-in-out infinite;
  pointer-events: none;
}

.dm-kpi::after {
  content: "";
  position: absolute;
  inset: auto -36px -52px auto;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: currentColor;
  opacity: .09;
  filter: blur(1px);
}

.dm-kpi:hover {
  transform: translateY(-6px) rotateX(2deg);
  box-shadow: 0 26px 54px rgba(15, 35, 55, .16);
  filter: saturate(1.08);
}

.dm-kpi:nth-child(2) { animation-delay: .06s; }
.dm-kpi:nth-child(3) { animation-delay: .12s; }
.dm-kpi:nth-child(4) { animation-delay: .18s; }
.dm-kpi:nth-child(5) { animation-delay: .24s; }
.dm-kpi:nth-child(6) { animation-delay: .3s; }

.dm-kpi i {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: #fff;
  border-radius: 16px;
  font-size: 1.45rem;
  box-shadow: 0 14px 28px color-mix(in srgb, currentColor 24%, transparent);
  animation: kpi-icon-pulse 3.4s ease-in-out infinite;
}

.dm-kpi span {
  position: relative;
  z-index: 1;
  display: block;
  color: #566176;
  min-height: 46px;
  font-size: clamp(1.02rem, .9vw, 1.18rem);
  font-weight: 800;
  line-height: 1.35;
}

.dm-kpi strong {
  position: relative;
  z-index: 1;
  display: block;
  color: #0F172A;
  margin-top: 6px;
  font-size: clamp(2rem, 2.55vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: normal;
}

.dm-kpi.pink i { background: #EA47A0; }
.dm-kpi.blue i { background: #5DA2F4; }
.dm-kpi.purple i { background: #A78BFA; }
.dm-kpi.green i { background: #10B981; }
.dm-kpi.orange i { background: #F97316; }
.dm-kpi.slate i { background: #64748B; }

.dm-chart-card {
  position: relative;
  padding: 22px 20px 26px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, .94);
  border-radius: 22px;
  box-shadow: 0 20px 45px rgba(126, 34, 206, .08);
  overflow: hidden;
}

.dm-chart-visual {
  border: 1px solid rgba(15, 118, 110, .12);
  background:
    radial-gradient(circle at 8% 10%, rgba(15, 118, 110, .1), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(217, 119, 6, .12), transparent 26%),
    rgba(255, 255, 255, .95);
  animation: chart-card-in .75s cubic-bezier(.2, .8, .2, 1) both;
}

.dm-chart-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .58) 42%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .4), transparent 40%);
  transform: translateX(-120%);
  animation: chart-shine 6s ease-in-out infinite;
  pointer-events: none;
}

.dm-chart-visual::after {
  content: "";
  position: absolute;
  inset: auto 26px 18px 26px;
  height: 34px;
  background: radial-gradient(ellipse at center, rgba(15, 35, 55, .16), transparent 68%);
  filter: blur(12px);
  opacity: .65;
  pointer-events: none;
}

.dm-card-head h2 {
  color: #D3167E;
  font-size: 1.05rem;
  font-weight: 900;
  margin: 0 0 16px;
}

#summary-table .dm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(15, 118, 110, .12);
}

#summary-table .dm-card-head h2 {
  margin-bottom: 0;
  color: #123047;
  font-size: clamp(1.25rem, 1.6vw, 1.8rem);
  line-height: 1.25;
}

.dm-chart-card canvas {
  position: relative;
  z-index: 1;
  width: 100% !important;
  min-height: 360px;
  max-height: 450px;
  filter: drop-shadow(0 18px 22px rgba(15, 35, 55, .12));
  animation: chart-canvas-float 7s ease-in-out infinite;
}

.dm-public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 0;
  padding: 18px 20px;
  color: #667085;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(15, 118, 110, .12);
  border-radius: 20px;
  box-shadow: 0 18px 38px rgba(15, 35, 55, .08);
}

.dm-public-footer div {
  display: grid;
  gap: 3px;
}

.dm-public-footer strong {
  color: #123047;
  font-size: 1rem;
  font-weight: 900;
}

.dm-public-footer span {
  font-size: .92rem;
  font-weight: 700;
}

@media (max-width: 860px) {
  .dm-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .dm-app { grid-template-columns: 1fr; }
  .dm-sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }
  .dm-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }
  .dm-login-bottom { display: none; }
  .dm-main { padding: 18px 14px 32px; }
  .dm-heading { align-items: flex-start; flex-direction: column; }
  .dm-filter-panel,
  .dm-kpis { grid-template-columns: 1fr; }
}

/* 2026 refresh: distinct teal, navy, amber theme. */
:root {
  --primary: #0F766E;
  --secondary: #D97706;
  --success: #059669;
  --danger: #DC2626;
  --bg: #F4F7F6;
  --card: #FFFFFF;
  --text: #16213A;
  --muted: #667085;
  --line: #D9E2E1;
  --shadow: 0 18px 42px rgba(15, 35, 55, .10);
}

.brand-mark {
  background: linear-gradient(135deg, #0F766E, #D97706);
}

.dm-dashboard-page {
  background:
    linear-gradient(90deg, #FFFFFF 0, #FFFFFF 260px, rgba(224, 242, 241, .92) 260px, rgba(239, 246, 255, .92) 64%, rgba(255, 247, 237, .82) 100%),
    #EEF6F5;
}

.dm-sidebar {
  background: rgba(255, 255, 255, .9);
  border-right-color: rgba(15, 118, 110, .14);
}

.dm-brand { color: #123047; }

.dm-brand span {
  background: linear-gradient(135deg, #0F766E, #D97706);
  box-shadow: 0 12px 24px rgba(15, 118, 110, .24);
}

.dm-nav a { color: #475467; }

.dm-nav a.active,
.dm-nav a:hover {
  color: #0F766E;
  background: #DDF5F1;
}

.dm-login-bottom,
.dm-search {
  background: #0F766E;
  box-shadow: 0 16px 28px rgba(15, 118, 110, .22);
}

.dm-login-bottom:hover,
.dm-search:hover {
  background: #115E59;
}

.dm-heading span,
.dm-card-head h2 {
  color: #D97706;
}

.dm-heading h1 {
  color: #123047;
}

.dm-login-top {
  background: #123047;
}

.dm-filter-panel,
.dm-kpi,
.dm-chart-card {
  box-shadow: 0 20px 45px rgba(15, 35, 55, .09);
}

.dm-filter-panel .form-control,
.dm-filter-panel .form-select {
  border-color: #B8DAD6;
}

.dm-reset {
  color: #123047;
  background: #FEF3C7;
}

.dm-kpi.pink i { background: #0F766E; }
.dm-kpi.blue i { background: #2563EB; }
.dm-kpi.purple i { background: #7C3AED; }
.dm-kpi.green i { background: #059669; }
.dm-kpi.orange i { background: #D97706; }
.dm-kpi.slate i { background: #123047; }

.dm-kpi {
  --kpi-accent: #0F766E;
  --kpi-accent-rgb: 15, 118, 110;
  --kpi-tilt-x: 0deg;
  --kpi-tilt-y: 0deg;
  --kpi-mx: 50%;
  --kpi-my: 50%;
  isolation: isolate;
  border: 1px solid rgba(var(--kpi-accent-rgb), .18);
  border-left: 0;
  background:
    radial-gradient(circle at var(--kpi-mx) var(--kpi-my), rgba(var(--kpi-accent-rgb), .16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .92)),
    #fff;
  box-shadow:
    0 18px 42px rgba(15, 35, 55, .11),
    0 2px 0 rgba(255, 255, 255, .92) inset,
    0 -24px 54px rgba(var(--kpi-accent-rgb), .08) inset;
  transform: translateY(0) rotateX(var(--kpi-tilt-x)) rotateY(var(--kpi-tilt-y));
  transform-style: preserve-3d;
}

.dm-kpi::after {
  background:
    radial-gradient(circle at 68% 72%, rgba(var(--kpi-accent-rgb), .16), transparent 0 58%, rgba(255, 255, 255, .28) 59% 100%);
  box-shadow:
    -20px -20px 50px rgba(var(--kpi-accent-rgb), .12),
    0 0 0 1px rgba(255, 255, 255, .55) inset;
}

.dm-kpi .kpi-edge {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: 24px 0 0 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .88), var(--kpi-accent) 26%, rgba(var(--kpi-accent-rgb), .62));
  box-shadow:
    0 0 26px rgba(var(--kpi-accent-rgb), .38),
    1px 0 0 rgba(255, 255, 255, .82) inset;
  transform: scaleY(.82);
  transform-origin: center;
  transition: transform .28s ease, width .28s ease;
  z-index: 2;
}

.dm-kpi .kpi-sheen {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, .62) 28%, transparent 45%),
    radial-gradient(circle at 80% 16%, rgba(var(--kpi-accent-rgb), .11), transparent 30%);
  mix-blend-mode: screen;
  opacity: .52;
  transform: translateX(-62%);
  transition: transform .8s cubic-bezier(.2, .8, .2, 1), opacity .28s ease;
  z-index: 0;
}

.dm-kpi .kpi-pulse-ring {
  position: absolute;
  inset: 26px auto auto 34px;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(var(--kpi-accent-rgb), .38);
  opacity: .5;
  animation: kpi-ring-breathe 4.6s ease-in-out infinite;
  z-index: 0;
}

.dm-kpi:hover,
.dm-kpi.is-hovering {
  transform: translateY(-8px) rotateX(var(--kpi-tilt-x)) rotateY(var(--kpi-tilt-y));
  box-shadow:
    0 28px 68px rgba(15, 35, 55, .19),
    0 18px 46px rgba(var(--kpi-accent-rgb), .16),
    0 2px 0 rgba(255, 255, 255, .96) inset;
}

.dm-kpi:hover .kpi-edge,
.dm-kpi.is-hovering .kpi-edge {
  width: 10px;
  transform: scaleY(1);
}

.dm-kpi:hover .kpi-sheen,
.dm-kpi.is-hovering .kpi-sheen {
  opacity: .72;
  transform: translateX(38%);
}

.dm-kpi.is-ready {
  animation-name: kpi-rise-in, kpi-card-breathe;
  animation-duration: .7s, 7.5s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1), ease-in-out;
  animation-fill-mode: both, none;
  animation-iteration-count: 1, infinite;
}

.dm-kpi.is-popping {
  animation: kpi-pop .42s cubic-bezier(.2, .8, .2, 1);
}

.dm-kpi > i,
.dm-kpi > span:not(.kpi-edge):not(.kpi-sheen):not(.kpi-pulse-ring),
.dm-kpi > strong {
  transform: translateZ(22px);
}

.dm-kpi.pink,
.dm-kpi.teal { --kpi-accent: #0F766E; --kpi-accent-rgb: 15, 118, 110; }
.dm-kpi.blue { --kpi-accent: #2563EB; --kpi-accent-rgb: 37, 99, 235; }
.dm-kpi.purple { --kpi-accent: #7C3AED; --kpi-accent-rgb: 124, 58, 237; }
.dm-kpi.green { --kpi-accent: #059669; --kpi-accent-rgb: 5, 150, 105; }
.dm-kpi.orange { --kpi-accent: #D97706; --kpi-accent-rgb: 217, 119, 6; }
.dm-kpi.slate { --kpi-accent: #123047; --kpi-accent-rgb: 18, 48, 71; }

.dm-kpi {
  min-height: 174px;
  padding: 22px 24px 20px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 255, 255, .2) 0 18%, transparent 19%),
    radial-gradient(circle at 3% 97%, rgba(255, 255, 255, .13) 0 14%, transparent 15%),
    radial-gradient(circle at 82% 106%, rgba(255, 255, 255, .16) 0 16%, transparent 17%),
    linear-gradient(135deg, var(--kpi-accent) 0%, color-mix(in srgb, var(--kpi-accent) 74%, #7C3AED) 54%, color-mix(in srgb, var(--kpi-accent) 58%, #60A5FA) 100%);
  box-shadow:
    0 30px 65px rgba(var(--kpi-accent-rgb), .26),
    0 14px 34px rgba(15, 23, 42, .16),
    0 1px 0 rgba(255, 255, 255, .38) inset;
}

.dm-kpi.pink,
.dm-kpi.teal {
  --kpi-accent: #0F766E;
  --kpi-accent-rgb: 15, 118, 110;
}

.dm-kpi.blue {
  --kpi-accent: #2563EB;
  --kpi-accent-rgb: 37, 99, 235;
}

.dm-kpi.purple {
  --kpi-accent: #6D28D9;
  --kpi-accent-rgb: 109, 40, 217;
}

.dm-kpi.green {
  --kpi-accent: #059669;
  --kpi-accent-rgb: 5, 150, 105;
}

.dm-kpi.orange {
  --kpi-accent: #D97706;
  --kpi-accent-rgb: 217, 119, 6;
}

.dm-kpi.slate {
  --kpi-accent: #123047;
  --kpi-accent-rgb: 18, 48, 71;
}

.dm-kpi::after {
  inset: auto -24px -44px auto;
  width: 138px;
  height: 138px;
  background: rgba(255, 255, 255, .13);
  box-shadow: none;
}

.dm-kpi .kpi-edge {
  display: none;
}

.dm-kpi .kpi-sheen {
  background:
    linear-gradient(115deg, transparent 12%, rgba(255, 255, 255, .35) 30%, transparent 48%),
    radial-gradient(circle at 94% 12%, rgba(255, 255, 255, .18), transparent 28%);
  opacity: .5;
}

.dm-kpi .kpi-pulse-ring {
  display: none;
}

.dm-kpi i {
  position: absolute;
  inset: 27px 34px auto auto;
  margin: 0;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, .18) !important;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 16px;
  box-shadow:
    0 16px 28px rgba(15, 23, 42, .16),
    0 0 0 8px rgba(255, 255, 255, .08),
    0 1px 0 rgba(255, 255, 255, .28) inset;
  backdrop-filter: blur(8px);
}

.dm-kpi > span:not(.kpi-edge):not(.kpi-sheen):not(.kpi-pulse-ring):not(.kpi-meta):not(.kpi-progress):not(.kpi-actions):not(.kpi-detail) {
  width: min(72%, 360px);
  min-height: 42px;
  color: rgba(255, 255, 255, .96);
  font-size: clamp(1rem, .92vw, 1.2rem);
  font-weight: 900;
  line-height: 1.2;
}

.dm-kpi strong {
  margin-top: 10px;
  color: #fff;
  font-size: clamp(2.3rem, 3.55vw, 3.85rem);
  font-weight: 950;
  line-height: .95;
  text-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}

.dm-kpi.slate strong {
  font-size: clamp(1.72rem, 2.2vw, 2.65rem);
  white-space: nowrap;
}

.dm-kpi .kpi-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: rgba(255, 255, 255, .76);
  font-size: .85rem;
  font-weight: 800;
}

.dm-kpi .kpi-meta span,
.dm-kpi .kpi-detail span {
  display: inline;
  width: auto;
  min-height: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  transform: none;
}

.dm-kpi .kpi-progress {
  position: relative;
  z-index: 2;
  display: block;
  min-height: 0;
  height: 7px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  overflow: hidden;
}

.dm-kpi .kpi-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--kpi-progress, 100%);
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 0 22px rgba(255, 255, 255, .48);
  animation: kpi-progress-fill 1s cubic-bezier(.2, .8, .2, 1) both;
}

.dm-kpi .kpi-actions {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 0;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.dm-kpi .kpi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #047857;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .14);
  font-size: .84rem;
  font-weight: 900;
  white-space: nowrap;
}

.dm-kpi .kpi-badge.is-warning {
  color: #B45309;
}

.dm-kpi .kpi-badge.is-danger {
  color: #DC2626;
}

.dm-kpi .kpi-badge.is-muted {
  color: #0F766E;
  background: rgba(255, 255, 255, .86);
}

.dm-kpi .kpi-detail {
  position: relative;
  z-index: 2;
  display: inline-flex;
  min-height: 0;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: rgba(255, 255, 255, .72);
  font-size: .94rem;
  font-weight: 850;
}

.dm-kpi .kpi-detail i {
  position: static;
  width: auto;
  height: auto;
  color: currentColor;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 1rem;
  animation: none;
  transform: none;
}

.dm-kpi:hover,
.dm-kpi.is-hovering {
  box-shadow:
    0 36px 84px rgba(var(--kpi-accent-rgb), .32),
    0 18px 42px rgba(15, 23, 42, .2),
    0 1px 0 rgba(255, 255, 255, .42) inset;
}

.login-redesign-page {
  background:
    radial-gradient(circle at 14% 16%, rgba(20, 184, 166, .22), transparent 25rem),
    radial-gradient(circle at 86% 84%, rgba(217, 119, 6, .18), transparent 28rem),
    #F4F7F6;
}

.login-redesign {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(620px, 1.12fr) minmax(440px, .88fr);
}

.login-hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px clamp(28px, 5vw, 72px);
  color: #FFFFFF;
  background:
    linear-gradient(150deg, rgba(18, 48, 71, .96), rgba(15, 118, 110, .93)),
    #123047;
  overflow: hidden;
  isolation: isolate;
}

.login-hero-panel::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -190px;
  bottom: -210px;
  border-radius: 999px;
  border: 72px solid rgba(255, 255, 255, .08);
  animation: login-orbit 12s ease-in-out infinite;
}

.login-hero-panel::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  left: -150px;
  top: 24%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(252, 211, 77, .16), transparent 68%);
  filter: blur(3px);
  animation: login-glow 9s ease-in-out infinite alternate;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 1.15rem;
  animation: login-fade-up .7s ease both;
}

.login-brand:hover { color: #fff; }

.login-brand span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #D97706;
  border-radius: 14px;
  animation: login-pulse 2.8s ease-in-out infinite;
}

.login-brand-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
}

.login-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 860px;
  animation: login-fade-up .8s ease .12s both;
}

.login-eyebrow {
  color: #FCD34D;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.login-hero-copy h1 {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  font-size: clamp(3rem, 4.2vw, 4.9rem);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: keep-all;
  text-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

.login-hero-copy h1 span {
  display: block;
  white-space: nowrap;
}

.login-hero-copy p {
  max-width: 720px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: 1.12rem;
  line-height: 1.8;
  overflow-wrap: normal;
  word-break: keep-all;
}

.login-stat-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  animation: login-fade-up .8s ease .25s both;
}

.login-stat-row div {
  padding: 16px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.login-stat-row div:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .28);
}

.login-stat-row span {
  display: block;
  color: rgba(255, 255, 255, .62);
  font-size: .8rem;
  font-weight: 800;
}

.login-stat-row strong {
  display: block;
  margin-top: 3px;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.login-form-panel::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: 7%;
  bottom: 8%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 119, 6, .18), transparent 70%);
  animation: login-soft-float 8s ease-in-out infinite;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid #D9E2E1;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 35, 55, .14);
  animation: login-card-in .75s cubic-bezier(.2, .8, .2, 1) both;
  transition: transform .2s ease, box-shadow .2s ease;
}

.login-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 70px rgba(15, 35, 55, .18);
}

.login-card-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.login-card-head > span {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0F766E;
  border-radius: 15px;
  font-size: 1.35rem;
}

.login-card h2 {
  margin: 0;
  color: #123047;
  font-size: 1.35rem;
  font-weight: 900;
}

.login-card p {
  margin: 2px 0 0;
  color: #667085;
  font-size: .92rem;
}

.login-field {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 14px;
  color: #344054;
  font-weight: 800;
}

.login-field span {
  grid-column: 1 / -1;
}

.login-field i {
  color: #0F766E;
}

.login-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #C9D8D6;
  border-radius: 12px;
  outline: 0;
}

.login-field input:focus {
  border-color: #0F766E;
  box-shadow: 0 0 0 .22rem rgba(15, 118, 110, .14);
}

.login-submit {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: #0F766E;
  border: 0;
  border-radius: 13px;
  font-weight: 900;
}

.login-submit:hover {
  background: #115E59;
  transform: translateY(-1px);
}

.login-submit {
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.login-submit:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .25);
  outline-offset: 3px;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-weight: 750;
  font-size: .92rem;
}

.login-actions a {
  color: #0F766E;
}

.login-note {
  margin-top: 18px;
  padding: 12px;
  color: #667085;
  background: #F4F7F6;
  border-radius: 12px;
  font-size: .88rem;
}

@media (max-width: 920px) {
  .login-redesign {
    grid-template-columns: 1fr;
  }
  .login-hero-panel {
    min-height: 430px;
  }
  .login-hero-copy h1 {
    font-size: clamp(2.6rem, 9vw, 4.2rem);
  }
}

@media (max-width: 620px) {
  .login-hero-panel,
  .login-form-panel {
    padding: 22px;
  }
  .login-stat-row {
    grid-template-columns: 1fr;
  }
  .login-actions {
    flex-direction: column;
  }
  .login-hero-copy h1 span {
    white-space: normal;
  }
}

@keyframes login-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-orbit {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-18px, -12px) rotate(5deg); }
}

@keyframes login-glow {
  from { transform: translate(0, 0) scale(1); opacity: .55; }
  to { transform: translate(30px, -24px) scale(1.12); opacity: .9; }
}

@keyframes login-soft-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-22px, 16px) scale(1.08); }
}

@keyframes login-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, .28); }
  50% { box-shadow: 0 0 0 9px rgba(217, 119, 6, 0); }
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

@keyframes kpi-rise-in {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes kpi-reflection {
  0%, 62% { transform: rotate(18deg) translateX(-125%); }
  82%, 100% { transform: rotate(18deg) translateX(260%); }
}

@keyframes kpi-icon-pulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 14px 28px color-mix(in srgb, currentColor 24%, transparent); }
  50% { transform: translateY(-2px); box-shadow: 0 18px 36px color-mix(in srgb, currentColor 34%, transparent); }
}

@keyframes kpi-card-breathe {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.08) brightness(1.015); }
}

@keyframes kpi-ring-breathe {
  0%, 100% { opacity: .22; transform: scale(.86); }
  50% { opacity: .55; transform: scale(1.16); }
}

@keyframes kpi-pop {
  0% { transform: translateY(-8px) scale(1) rotateX(var(--kpi-tilt-x)) rotateY(var(--kpi-tilt-y)); }
  48% { transform: translateY(-10px) scale(1.025) rotateX(var(--kpi-tilt-x)) rotateY(var(--kpi-tilt-y)); }
  100% { transform: translateY(-8px) scale(1) rotateX(var(--kpi-tilt-x)) rotateY(var(--kpi-tilt-y)); }
}

@keyframes kpi-progress-fill {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}

@keyframes chart-card-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes chart-shine {
  0%, 55% { transform: translateX(-120%); }
  78%, 100% { transform: translateX(120%); }
}

@keyframes chart-canvas-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes float-button-breathe {
  0%, 100% { box-shadow: 0 18px 34px rgba(15, 35, 55, .24), 0 0 0 0 rgba(15, 118, 110, .28); }
  50% { box-shadow: 0 22px 42px rgba(15, 35, 55, .28), 0 0 0 9px rgba(15, 118, 110, 0); }
}

@keyframes float-arrow-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes float-button-shine {
  0%, 60% { transform: rotate(24deg) translate(-80px, 16px); }
  82%, 100% { transform: rotate(24deg) translate(80px, -20px); }
}

@keyframes float-button-pop {
  0% { transform: scale(1); }
  45% { transform: scale(.9); }
  100% { transform: scale(1.05); }
}

/* Responsive hardening across dashboard, admin, auth, upload, charts and tables. */
img,
svg,
canvas,
video {
  max-width: 100%;
}

.table-responsive,
.dataTables_wrapper,
.dataTables_scroll,
.dataTables_scrollHead,
.dataTables_scrollBody {
  max-width: 100%;
}

.dataTables_wrapper {
  overflow: hidden;
}

.dataTables_scrollBody {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .row {
  --bs-gutter-x: .75rem;
}

.dataTables_filter,
.dataTables_info,
.dataTables_paginate,
.dt-buttons {
  max-width: 100%;
}

.dataTables_filter label {
  width: min(100%, 320px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dataTables_filter input {
  width: 100% !important;
  min-width: 0;
  flex: 1 1 auto;
  margin-left: 0 !important;
}

.dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dt-buttons .btn {
  margin: 0;
}

.panel,
.form-surface,
.auth-card,
.privacy-box,
.dm-chart-card,
.upload-preview,
.login-card {
  max-width: 100%;
}

@media (max-width: 1280px) {
  .dm-app {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .dm-dashboard-page {
    background:
      linear-gradient(90deg, #FFFFFF 0, #FFFFFF 220px, rgba(224, 242, 241, .92) 220px, rgba(239, 246, 255, .92) 68%, rgba(255, 247, 237, .82) 100%),
      #EEF6F5;
  }

  .dm-sidebar {
    padding: 18px 14px;
  }

  .dm-main {
    padding: 24px 22px 42px;
  }

  .dm-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
  }

  .dm-kpi {
    padding: 20px 20px 18px;
  }
}

@media (max-width: 1100px) {
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .dm-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dm-search,
  .dm-reset {
    width: 100%;
  }

  .dm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-redesign {
    grid-template-columns: 1fr;
  }

  .login-hero-panel {
    min-height: auto;
    gap: 34px;
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .dashboard-heading,
  .section-head,
  .dm-heading,
  .upload-preview-head,
  .upload-preview-actions,
  .upload-preview-actions form:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .dm-app {
    display: block;
  }

  .dm-dashboard-page {
    background:
      linear-gradient(180deg, rgba(224, 242, 241, .95), rgba(239, 246, 255, .92) 58%, rgba(255, 247, 237, .8)),
      #EEF6F5;
  }

  .dm-sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(15, 118, 110, .14);
  }

  .dm-brand {
    margin-bottom: 10px;
  }

  .dm-nav,
  .app-sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .dm-nav a,
  .app-sidebar a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .dm-login-bottom {
    display: none;
  }

  .dm-main,
  .admin-content {
    padding: 18px 14px 36px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 65px;
    z-index: 35;
    background: #0F172A;
  }

  .sidebar-title {
    display: none;
  }

  .dm-heading h1,
  .dashboard-heading h1,
  .section-head h1 {
    font-size: clamp(1.35rem, 5vw, 2rem);
  }

  .dm-login-top {
    width: fit-content;
  }

  .dm-chart-card {
    padding: 18px 14px 22px;
    border-radius: 18px;
  }

  .dm-chart-card canvas,
  .panel canvas {
    min-height: 300px;
    max-height: 380px;
  }

  .upload-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .container-fluid {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .navbar-brand {
    max-width: calc(100vw - 92px);
    font-size: 1rem;
  }

  .brand-logo-img,
  .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .filter-bar,
  .kpi-grid,
  .kpi-grid.compact,
  .dm-filter-panel,
  .dm-kpis,
  .upload-preview-grid,
  .login-stat-row {
    grid-template-columns: 1fr;
  }

  .dm-filter-panel {
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
  }

  .dm-search,
  .dm-reset {
    min-height: 44px;
  }

  .dm-kpi {
    min-height: 236px;
    padding: 18px;
    border-radius: 20px;
  }

  .dm-kpi i {
    inset: 22px 24px auto auto;
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .dm-kpi > span:not(.kpi-edge):not(.kpi-sheen):not(.kpi-pulse-ring):not(.kpi-meta):not(.kpi-progress):not(.kpi-actions):not(.kpi-detail) {
    width: calc(100% - 72px);
    min-height: 34px;
    font-size: 1rem;
  }

  .dm-kpi strong {
    font-size: clamp(2.35rem, 14vw, 3.6rem);
  }

  .dm-kpi.slate strong {
    font-size: clamp(1.75rem, 8vw, 2.45rem);
  }

  .dm-kpi .kpi-actions {
    gap: 8px;
  }

  .dm-kpi .kpi-badge {
    min-height: 34px;
    padding: 7px 11px;
    font-size: .82rem;
  }

  .dm-chart-card canvas,
  .panel canvas {
    min-height: 260px;
    max-height: 330px;
  }

  .treatment-table {
    min-width: 860px;
  }

  .treatment-table-wrap .dataTables_filter,
  .dataTables_filter {
    width: 100%;
  }

  .dataTables_filter label {
    width: 100%;
  }

  .dataTables_filter input {
    max-width: 100%;
  }

  .dataTables_info,
  .dataTables_paginate {
    text-align: left !important;
    margin-top: 10px;
  }

  .dataTables_paginate .pagination {
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 4px;
  }

  .rate-pill,
  .status-pill {
    min-width: 92px;
    font-size: .86rem;
  }

  .form-surface,
  .auth-card,
  .privacy-box,
  .upload-preview {
    padding: 16px;
    border-radius: 16px;
  }

  .admin-action-row {
    min-width: 0;
    flex-wrap: wrap;
  }

  .login-hero-panel,
  .login-form-panel {
    padding: 20px 16px;
  }

  .login-hero-copy h1 {
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .login-hero-copy p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .login-card {
    padding: 20px;
    border-radius: 18px;
  }

  .login-actions {
    flex-direction: column;
  }

  .dm-float-nav {
    right: 14px;
    bottom: 18px;
  }

  .dm-float-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 420px) {
  .dm-main,
  .admin-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .dm-brand strong {
    font-size: .95rem;
  }

  .dm-nav a,
  .app-sidebar a {
    padding: 10px 12px;
    font-size: .9rem;
  }

  .dm-kpi {
    min-height: 224px;
  }

  .dm-kpi .kpi-meta {
    font-size: .78rem;
  }

  .dm-kpi .kpi-badge {
    font-size: .76rem;
  }

  .dm-chart-card {
    padding-left: 10px;
    padding-right: 10px;
  }

  .dm-public-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
  }

  .login-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand,
  .login-brand span,
  .login-hero-copy,
  .login-stat-row,
  .login-card,
  .login-hero-panel::before,
  .login-hero-panel::after,
  .login-form-panel::before,
  .dm-brand span,
  .dm-brand-img,
  .dm-float-btn,
  .dm-float-btn::after,
  .dm-float-btn i,
  .dm-kpi,
  .dm-kpi::before,
  .dm-kpi i,
  .dm-kpi .kpi-pulse-ring,
  .dm-kpi .kpi-progress::before,
  .dm-chart-visual,
  .dm-chart-visual::before,
  .dm-chart-card canvas {
    animation: none !important;
  }
}
